<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <!-- <script src="https://cdn.staticfile.org/jquery/3.6.0/jquery.js"></script> -->
  <script src="https://cdn.staticfile.org/axios/0.21.1/axios.js"></script>
  <script>
    // $.ajax({
    //   type: 'POST',
    //   url: 'https://www.escook.cn/api/post',
    //   data: {
    //     name: 'zs',
    //     age: 20
    //   },
    //   success(res) {
    //     console.log(res)
    //   }
    // })

    // $.post('https://www.escook.cn/api/post', {name: 'zs', age: 20}, (res) => {
    //   console.log(res)
    // })

    /* axios({
      method: 'GET',
      url: 'https://www.escook.cn/api/get',
      params: {name: 'zs', age: 20}
    }).then(res => {
      console.log(res)
    }) */

    axios({
      method: 'POST',
      url: 'https://www.escook.cn/api/post',
      data: {name: 'zs', age: 20},
      headers: {
        'Long': 'xxx'
      }
    }).then(res => {
      console.log(res)
    })

    /* axios.get('https://www.escook.cn/api/get', {
      // GET 参数
      params: {
        name: 'zs',
        age: 20
      },
      headers: {
        'Long': 'xxx'
      }
    }).then(res => {
      console.log(res)
    }) */

    /* axios.post('https://www.escook.cn/api/post', { name: 'ls', age: 33 }, {
      headers: {
        'Long': 'xxx'
      }
    }).then(res => {
      console.log(res)
    }) */
  </script>
</body>
</html>